Repository navigation
adopt: validate DSL output against the engine's imposter JSON Schema (sdk-conformance schema/imposter.schema.json) - #314
Merged
Conversation
…JSON Schema rift 0.22.0 ships the imposter grammar as a closed draft 2020-12 schema in the sdk-conformance tarball (rift#1342). SchemaConformanceTest validates what the DSL builds and what the codec writes back for every fixture, and checks each model's hand-kept MODELED_KEYS and the predicate parameter set against the schema's $defs, so those lists can no longer drift from the engine the way flowState.backend and keyCaseSensitive did. A corpus without schema/ skips the gate; the RIFT_IT lane fails instead when a 0.22.0+ corpus lacks it. The validator (networknt json-schema-validator) is test-scope in the unpublished conformance module. Closes #300
2 tasks
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rift 0.22.0 ships the engine's imposter grammar as a JSON Schema (draft 2020-12) inside the sdk-conformance tarball, at
schema/imposter.schema.json(rift#1342). Every object in it is closed (additionalProperties: false) except the provider maps. A document that validates therefore carries no key the engine never reads.Changes
SchemaConformanceTest, the conformance module's "Schema" gate:dslOutputValidates: every DSL-built fixture validates against the schema.codecOutputValidates: every fixture'sfromJson → toJsonoutput validates. A parse failure outsideKnownFidelityGapsis rethrown.modeledKeysAreKeysTheEngineReads: each of the 7 model types'MODELED_KEYSmust be a subset of its$defsproperties. The keys are read reflectively.predicateParametersAreExactlyTheSchemasNonOperatorKeys: checksPredicateOperation.RESERVED_KEYSin both directions.theValidatorRejectsAKeyTheEngineNeverReads: negative cases (an unread stub key, an unread_riftkey reached through$ref, a mistypedstatusCode), so a no-op validator cannot pass.Corpus.schema(): finds the schema by file presence. A corpus without it skips the gate. TheRIFT_IT=1lane fails instead when a 0.22.0+ corpus lacks it.com.networknt:json-schema-validator1.5.6. It lives in the conformance module, which is not deployed, so core stays dependency-free. Jackson is aligned by the root BOM.The issue asked to "derive MODELED_KEYS from
$defs". Core doesn't ship the schema, so deriving the keys at runtime isn't possible. Instead, the hand-kept lists are checked against the schema on every conformance run.Verification
./mvnw -B verify -Drift.corpus.root=<0.22.0 corpus>: green.SchemaConformanceTestran 33 tests (2 aborted: fixtures with no DSL builder, or a known fidelity gap).backendtoRiftFlowStateConfig.MODELED_KEYS→modeledKeysAreKeysTheEngineReadsfails with{RiftFlowStateConfig=[backend]};Stubemit an unread key → 29 failures, each namingproperty 'nmae' is not defined in the schema.Closes #300
🤖 Generated with Claude Code